package huang.homework11.q1;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class StudentConcrol {
		//创建删除成绩最差的两名同学的方法；
		public boolean deleteStu(){
			BaseDao bd=new BaseDao();
			Connection con=bd.getCon();
			String sql="delete from scores order by score limit 2";
			try {
				PreparedStatement ps =con.prepareStatement(sql);
				ps.executeUpdate();
				if(ps!=null){
					ps.close();
				}
				if(con!=null){
					con.close();
				}
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			return true;
		}
}
